package graph.geometricshapes
{
	public class GeometricTriangle extends GeometricShape
	{
		public static const NAME:String = "GeometricTriangle"
		public override function get getName():String
		{
			return NAME;
		}		
		
		public function get sideLength():Number
		{	
			var result:Number = Math.sqrt(Math.pow(width/2,2) + Math.pow(height,2));
			return result;
		}
		
		public function GeometricTriangle(width:Number = DefaultWidth, height:Number = DefaultHeight)
		{
			super(width,height);
		}
		
		public override function getArea():Number
		{
			var result:Number = width*height/2; 
			return result;
		}
		
		public override function getPerimeter():Number
		{
			var result:Number = (2*sideLength) + width;
			return result;
		}
		
	}
}